package com.listerner;

import com.service.SeckillService;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
@RabbitListener(queues = {"sunjob_queue"})
public class SeckillListern {

    @Autowired
    private SeckillService seckillService;

    @RabbitHandler
    public void setSeckillHandler(Map map){
        Integer goodsId = (Integer) map.get("goodsId");
        Integer uid  = (Integer) map.get("uid");
        //调用业务层...略
        System.out.println(uid);
        System.out.println(goodsId);

    }


}
